From 63dd31cd31f76003c26871516b40e9434c578555 Mon Sep 17 00:00:00 2001 From: addshore Date: Fri, 4 Nov 2016 11:40:42 +0100 Subject: [PATCH] Add access modifiers to htmlform classes Change-Id: Id8c0f0676b3200993af3cec493efc99839211bcc --- includes/htmlform/HTMLFormField.php | 30 +++++++++---------- includes/htmlform/HTMLNestedFilterable.php | 2 +- includes/htmlform/OOUIHTMLForm.php | 10 +++---- includes/htmlform/VFormHTMLForm.php | 6 ++-- .../fields/HTMLAutoCompleteSelectField.php | 10 +++---- includes/htmlform/fields/HTMLCheckField.php | 6 ++-- includes/htmlform/fields/HTMLCheckMatrix.php | 12 ++++---- .../htmlform/fields/HTMLComboboxField.php | 4 +-- .../htmlform/fields/HTMLDateTimeField.php | 4 +-- includes/htmlform/fields/HTMLFloatField.php | 4 +-- includes/htmlform/fields/HTMLInfoField.php | 2 +- includes/htmlform/fields/HTMLIntField.php | 2 +- .../htmlform/fields/HTMLMultiSelectField.php | 12 ++++---- includes/htmlform/fields/HTMLRadioField.php | 8 ++--- .../htmlform/fields/HTMLRestrictionsField.php | 2 +- .../fields/HTMLSelectAndOtherField.php | 12 ++++---- includes/htmlform/fields/HTMLSelectField.php | 6 ++-- .../htmlform/fields/HTMLSelectLimitField.php | 2 +- .../htmlform/fields/HTMLSelectNamespace.php | 2 +- .../fields/HTMLSelectOrOtherField.php | 8 ++--- .../htmlform/fields/HTMLSizeFilterField.php | 8 ++--- includes/htmlform/fields/HTMLTagFilter.php | 6 ++-- .../htmlform/fields/HTMLTextAreaField.php | 8 ++--- includes/htmlform/fields/HTMLTextField.php | 8 ++--- 24 files changed, 87 insertions(+), 87 deletions(-) diff --git a/includes/htmlform/HTMLFormField.php b/includes/htmlform/HTMLFormField.php index 4afdea76f8..8390a0bbbe 100644 --- a/includes/htmlform/HTMLFormField.php +++ b/includes/htmlform/HTMLFormField.php @@ -42,7 +42,7 @@ abstract class HTMLFormField { * * @return string Valid HTML. */ - abstract function getInputHTML( $value ); + abstract public function getInputHTML( $value ); /** * Same as getInputHTML, but returns an OOUI object. @@ -51,7 +51,7 @@ abstract class HTMLFormField { * @param string $value * @return OOUI\Widget|false */ - function getInputOOUI( $value ) { + public function getInputOOUI( $value ) { return false; } @@ -74,7 +74,7 @@ abstract class HTMLFormField { * * @return Message */ - function msg() { + public function msg() { $args = func_get_args(); if ( $this->mParent ) { @@ -266,7 +266,7 @@ abstract class HTMLFormField { * @param array $alldata The data collected from the form * @return bool */ - function isHidden( $alldata ) { + public function isHidden( $alldata ) { if ( !$this->mHideIf ) { return false; } @@ -284,7 +284,7 @@ abstract class HTMLFormField { * * @return bool True to cancel the submission */ - function cancelSubmit( $value, $alldata ) { + public function cancelSubmit( $value, $alldata ) { return false; } @@ -299,7 +299,7 @@ abstract class HTMLFormField { * @return bool|string True on success, or String error to display, or * false to fail validation without displaying an error. */ - function validate( $value, $alldata ) { + public function validate( $value, $alldata ) { if ( $this->isHidden( $alldata ) ) { return true; } @@ -318,7 +318,7 @@ abstract class HTMLFormField { return true; } - function filter( $value, $alldata ) { + public function filter( $value, $alldata ) { if ( isset( $this->mFilterCallback ) ) { $value = call_user_func( $this->mFilterCallback, $value, $alldata, $this->mParent ); } @@ -370,7 +370,7 @@ abstract class HTMLFormField { * @param WebRequest $request * @return string The value */ - function loadDataFromRequest( $request ) { + public function loadDataFromRequest( $request ) { if ( $request->getCheck( $this->mName ) ) { return $request->getText( $this->mName ); } else { @@ -386,7 +386,7 @@ abstract class HTMLFormField { * @since 1.22 The 'label' attribute no longer accepts raw HTML, use 'label-raw' instead * @throws MWException */ - function __construct( $params ) { + public function __construct( $params ) { $this->mParams = $params; if ( isset( $params['parent'] ) && $params['parent'] instanceof HTMLForm ) { @@ -472,7 +472,7 @@ abstract class HTMLFormField { * * @return string Complete HTML table row. */ - function getTableRow( $value ) { + public function getTableRow( $value ) { list( $errors, $errorClass ) = $this->getErrorsAndErrorClass( $value ); $inputHtml = $this->getInputHTML( $value ); $fieldType = get_class( $this ); @@ -903,7 +903,7 @@ abstract class HTMLFormField { * @since 1.28 * @return string[] */ - function getNotices() { + public function getNotices() { $notices = []; if ( isset( $this->mParams['notice-message'] ) ) { @@ -924,11 +924,11 @@ abstract class HTMLFormField { /** * @return string HTML */ - function getLabel() { + public function getLabel() { return is_null( $this->mLabel ) ? '' : $this->mLabel; } - function getLabelHtml( $cellAttributes = [] ) { + public function getLabelHtml( $cellAttributes = [] ) { # Don't output a for= attribute for labels with no associated input. # Kind of hacky here, possibly we don't want these to be